/*
 *  captureCameraManager.h
 *  opencvExample
 *
 *  Created by 真鍋 大度 on 11/02/28.
 *  Copyright 2011 Rhizomatiks. All rights reserved.
 *
 */

#pragma once

#include "ofMain.h"
#include "ofxOpenCv.h"

//#define _USE_LIVE_VIDEO		// uncomment this to use a live camera


class captureCameraManager{
public:
	
	void setup(int _widthCam, int _heightCam, int _widthSpiral, int _heightSpiral);
	void update();
	void draw();
	
	#ifdef _USE_LIVE_VIDEO
	ofVideoGrabber 		vidGrabber;
	#else
	ofVideoPlayer 		vidPlayer;
	#endif

	ofxCvColorImage		colorImg;	
	ofxCvGrayscaleImage 	grayImage;	
	ofxCvGrayscaleImage 	grayBg;
	ofxCvGrayscaleImage 	grayDiff;
	
	ofxCvContourFinder 	contourFinder;
	
	int 				threshold;
	bool				bLearnBakground;
	int				widthCam, heightCam;	
	int				widthCamSmall, heightCamSmall;
	int				widthSpiral, heightSpiral;
	ofxCvGrayscaleImage graySmallImage;
	unsigned char	* pixelsGrayCamSmall;
	
	ofxCvGrayscaleImage graySpiralImage;	
	unsigned char	* pixelsGraySpiral;
	unsigned char * getGrayPixels();
};